package pl.com.like.sequoia.model.log;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import pl.com.like.sequoia.model.admin.UploadedFile;
import pl.com.like.sequoia.model.bio.BioObjectHandler;
import pl.com.like.sequoia.model.security.User;

@Entity
@Table(name = "uploaded_file_log")
@SequenceGenerator(name = "UploadedFileLogSeq", sequenceName = "uploaded_file_log_seq", allocationSize = 1)
public class UploadedFileLog implements Serializable {

	@Transient
	private static final long serialVersionUID = -5922487082838365110L;

	@Id
	@Column(name = "id")
	@GeneratedValue(generator = "UploadedFileLogSeq", strategy = GenerationType.SEQUENCE)
	private Long id;
	@ManyToOne
	@JoinColumn(name = "user_id", nullable = true)
	private User user;
	@Column(name = "created", nullable = false)
	private Date created;
	@ManyToOne
	@JoinColumn(name = "uploaded_file_id", nullable = true)
	private UploadedFile uploadedFile;

	@ManyToOne
	@JoinColumn(name = "bio_object_id", nullable = true)
	private BioObjectHandler bioObjectHandler;

	@Column(name = "message", nullable = false, length = 3000)
	private String message;

	public BioObjectHandler getBioObjectHandler() {
		return bioObjectHandler;
	}

	public Date getCreated() {
		return created;
	}

	public Long getId() {
		return id;
	}

	public String getMessage() {
		return message;
	}

	public UploadedFile getUploadedFile() {
		return uploadedFile;
	}

	public User getUser() {
		return user;
	}

	public void setBioObjectHandler(BioObjectHandler bioObjectHandler) {
		this.bioObjectHandler = bioObjectHandler;
	}
	public void setCreated(Date created) {
		this.created = created;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public void setUploadedFile(UploadedFile uploadedFile) {
		this.uploadedFile = uploadedFile;
	}
	public void setUser(User user) {
		this.user = user;
	}

}
